﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace Lil_Chipper
{
    [Serializable()]
    public sealed class Story
    {
        public string ID;
        public int    Chapters;
        public string Name;
        public string SaveTo;

        public Story()
        {
            ID       = "0";
            Chapters = 1;
            Name     = "New Story";
            SaveTo   = "C:\\";
        }

        public Story( SerializationInfo info, StreamingContext ctxt )
        {
            ID       = ( string ) info.GetValue( "ID",       typeof( string ) );
            Chapters = ( int    ) info.GetValue( "Chapters", typeof( int    ) );
            Name     = ( string ) info.GetValue( "Name",     typeof( string ) );
            SaveTo   = ( string ) info.GetValue( "SaveTo",   typeof( string ) );
        }

        public void GetObjectData( SerializationInfo info, StreamingContext ctxt )
        {
            info.AddValue( "ID",       ID       );
            info.AddValue( "Chapters", Chapters );
            info.AddValue( "Name",     Name     );
            info.AddValue( "SaveTo",   SaveTo   );
        }
    };
}
